class Float
  def round_to(x)
    (self * 10**x).round.to_f / 10**x
  end

  def ceil_to(x)
    (self * 10**x).ceil.to_f / 10**x
  end

  def floor_to(x)
    (self * 10**x).floor.to_f / 10**x
  end
end

#arr = [1, 2, 3, 2, 2, 3, 4, 5, 2, 1, 1, 3, 1].collect{|v| v * 0.5}
arr = [0.5, 2, 4, 8, 8, 4, 2, 1, 1, 0.5].collect{|v| v * 0.5}
div = 12
len = arr.length

pts = []

div.times{|c|
  i = 0
  arr.each{|v|
    x = (v * Math.sin(c * (2 * Math::PI / div))).round_to 3
    z = (v * Math.cos(c * (2 * Math::PI / div))).round_to 3
    y = (i - (len /2)) * 0.5
    i += 1
    pts.push([x, y, z])
  }
}

faces = []
f1 = [div] +  (0..(div-1)).collect{|n| n * len}.reverse
f2 = [div] +  ((0..(div-1)).collect{|n| (n+1) * len - 1})
faces.push f1
faces.push f2

div.times{|c|
  (arr.length-1).times{|i|
    faces.push([4, 
      i + c * len,
      (i + (c+1) * len) % (div * len),
      (i+1 + (c+1) * len) % (div * len),
      (i+1 + c * len) % (div * len)])
  }
}

puts "OFF"
puts "#{pts.length} #{faces.length}"
pts.each{|p| puts p.join(" ") }
faces.each{|f| puts f.join(" ") }